#include<iostream>
#include<cstring>
using namespace std;

int main(){
	int mom=0,jin=0,month,mm=0;
	for(int i=1;i<=12;i++){
		cin>>month;
		mm++;
		if(jin+300-month<0){
			cout<<"-"<<mm<<endl;
			return 0;
		}
		mom = mom+((jin+300-month)/100)*100;
		jin = (jin+300-month)%100;
	}
	cout<<mom*1.2+jin<<endl;
	return 0;
}
